package com.yonyou.cms.epc.service.shoppingCart;

import com.yonyou.cms.epc.client.dto.shoppingCart.ShoppingCartDTO;
import com.yonyou.cms.epc.client.entity.shoppingCart.ShoppingCartPO;
import com.yonyou.cyx.framework.service.base.ICommonService;

import java.util.List;
import java.util.Map;

/**
 * @description: 购物车service接口
 * @author: chengbufang
 * @date: 2022-06-29 14:45
 */
public interface ShoppingCartService extends ICommonService<ShoppingCartDTO, ShoppingCartPO, Integer> {

    /**
     * 查询购物车列表
     * @param params
     * @return
     */
    List<ShoppingCartPO> getCartList(Map<String, Object> params);

    /**
     * 购物车提交订单时查询相关信息
     * @param cartList
     * @return
     */
    List<Map<String, Object>> reportOrder(List<ShoppingCartPO> cartList);

    /**
     * 加入购物车
     * @param shoppingCartDto
     */
    Map<String, Object> pushToCart(ShoppingCartDTO shoppingCartDto);

    /**
     * 删除购物车
     * @param ids
     * @return
     */
    Map<String, Object> deleteFromCart(List<Long> ids);

    /**
     * 查询购物车条数
     * @param params
     * @return
     */
    Integer getCartCount(Map<String, Object> params);

    /**
     * 清空购物车
     * @param params
     * @return
     */
    Map<String, Object> clearCart(Map<String, Object> params);

    /**
     * 校验备件是否符合订单类型
     * @param params
     * @return
     */
    Integer checkOrderType(Map<String, Object> params);
}
